package com.wit.zhenghao.day11;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

public class DemoReader {

	@Test
	public void test() {
		try (
				InputStreamReader is = new InputStreamReader(new FileInputStream("a.txt"));
		){
			char[] chars = new char[1024];
			int count = 0;
			while((count = is.read(chars)) != -1) {
				System.out.println(new String(chars,0,count));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
